package com.woniuxy.topic;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/4 0004-下午 5:24
 */
@Component
public class TopicProductor {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(){
        rabbitTemplate.convertAndSend("topicExchange","chengdu.news","成都一男子纵火");
        rabbitTemplate.convertAndSend("topicExchange","tech.news","天问一号即将发射");
    }
}
